# -*- coding: utf-8 -*-
import os

class Renamer:
    def __init__(self):
        pass


    def batch_rename(self, path, prefix, replace_pair = {}, onlyshow = True):
        for file in os.listdir(path):
            aftfile = str(file)
            for key in replace_pair.keys():
                aftfile = aftfile.replace(key,replace_pair[key])
            aftfile = prefix + aftfile
            if not onlyshow:
                try:
                    os.rename(os.path.join(path,file),os.path.join(path,aftfile))
                except print("!"):
                    pass
            print(file, " -> ", aftfile)


    def get_drama_name_from_path(self, full_path = str()):
        # full_path will be like this: 
        full_path = "Z:/等待下载211112/美剧/【1号文件库】-书等多个文件/卢克·凯特/Marvel's Luke Cage (2016) Season 1 S01 (1080p BluRay x265 HEVC 10bit AAC 5.1 Vyndros) [UTR]/Marvel's.Luke.Cage.S01E01.Moment.of.Truth.1080p.10bit.BluRay.AAC5.1.HEVC-Vyndros.mkv"
        full_path.replace("\\", "/")
        divided = full_path.split("/")
        print(divided)


def main():
    print("Thanks for using XT's renamer!")
    rr = Renamer();
    rr.get_drama_name_from_path("")

if __name__ == '__main__':
    main()
    